﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.SysRole.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.SysRole;
/// <summary>
/// 获取系统角色列表服务
/// </summary>
public class GetSysRoleListService : ApiBase<RequestGetSysRoleListModel>
{
    /// <summary>
    /// 系统角色仓储
    /// </summary>
    public SysRoleRep sysRoleRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new SysRoleModel();

        model.RoleName = Parameter.RoleName;
        model.RoleKey = Parameter.RoleKey;
        model.DataScope = Parameter.DataScope;
        model.MenuCheckStrictly = Parameter.MenuCheckStrictly;
        model.DeptCheckStrictly = Parameter.DeptCheckStrictly;
        model.Status = Parameter.Status;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = sysRoleRep.GetSysRoleList(model, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}

